#include <iostream>

using namespace std;

int main(){
	int n;
	cin >> n;
	while(n--){
		unsigned int sum,res;
		cin >> sum >> res;
		if (sum<res){
		       	cout << "impossible" << endl;
			continue;
		}
		unsigned int a=(sum-res)/2,b;
		if ((sum-res)-(a*2)==0){
			b=sum-a;
			if (b>a)
				cout << b << " " << a << endl;
			else
				cout << a << " " << b << endl;
		}
		else
		{
			cout << "impossible" << endl;
		}
	}
}
